
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Threading;
using System.Diagnostics;

namespace Curchy.PERTToolbox.Service.Async
{
    public class AsyncBase
    {

        private Thread _asyncThread;

        public void Start()
        {
            ThreadStart ts = new ThreadStart(AsyncStart);
            _asyncThread = new Thread(ts);
            _asyncThread.IsBackground = true;
            _asyncThread.Name = this.GetType().ToString();
            _asyncThread.Start();
        }

        public void Stop()
        {
            _asyncThread.Abort();
        }

        private void AsyncStartInner()
        {
            AsyncStart();
        }

        protected virtual void AsyncStart()
        {
        }
    }
}
